Skip to content

[Base] Add status copy allocation and payload inspection APIs#23698

Merged
benvanik merged 1 commit intomainfrom
users/benvanik/base-status-extensions
Mar 9, 2026
Merged

[Base] Add status copy allocation and payload inspection APIs#23698
benvanik merged 1 commit intomainfrom
users/benvanik/base-status-extensions

Conversation

@benvanik
Copy link
Copy Markdown
Collaborator

@benvanik benvanik commented Mar 9, 2026

Properly closes #55. heh.


Add iree_status_allocate_copy() which copies both file and message into trailing storage, producing self-contained statuses with no dangling pointers. This is needed for deserialized statuses where the source buffer is transient.

Also add public APIs for inspecting status internals:

  • iree_status_source_location(): extract file:line from a status
  • iree_status_message(): extract the primary message string
  • iree_status_payload_visitor_fn_t: callback for iterating payloads
  • iree_status_payload_type_t enum: typed payload classification

Move iree_status_payload_t definition from status_payload.h to status.h so the visitor callback can reference it in the public API.

Add iree_status_allocate_copy() which copies both file and message into
trailing storage, producing self-contained statuses with no dangling
pointers. This is needed for deserialized statuses where the source
buffer is transient.

Also add public APIs for inspecting status internals:
- iree_status_source_location(): extract file:line from a status
- iree_status_message(): extract the primary message string
- iree_status_payload_visitor_fn_t: callback for iterating payloads
- iree_status_payload_type_t enum: typed payload classification

Move iree_status_payload_t definition from status_payload.h to status.h
so the visitor callback can reference it in the public API.

Co-Authored-By: Claude <[email protected]>
@benvanik benvanik added runtime/api IREE's public C runtime API and iree-run-module post-merge-review Ben's special place. People can pick these up and review them for forward fixes if interested. labels Mar 9, 2026
@benvanik benvanik requested a review from stellaraccident March 9, 2026 05:21
@benvanik benvanik marked this pull request as ready for review March 9, 2026 05:21
@benvanik benvanik merged commit de74bde into main Mar 9, 2026
61 checks passed
@benvanik benvanik deleted the users/benvanik/base-status-extensions branch March 9, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-merge-review Ben's special place. People can pick these up and review them for forward fixes if interested. runtime/api IREE's public C runtime API and iree-run-module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rich cross-environment stack traces

1 participant